﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Input;
using Douban.Core.Settings;
using Douban.Core.Interop;

namespace Douban.Core.Commands
{
    public class ReturnKeyDownCommandBehavior : CommandBehaviorBase<UIElement>
    {
        public ReturnKeyDownCommandBehavior(UIElement target) : base(target)
        {
            target.KeyDown += (sender, e) =>
                {
                    if (e.Key == Key.Enter) 
                    {
                        ExecuteCommand(e);
                    }
                };
        }
    }
}
